// pages/message/message.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    messageInput: '',
    messages: [],

    BASE_URL: "127.0.0.1:8080/chat",
    SERVER_EMAIL: "88573134@qq.com",
    websocket: null,
    uuid: null,
    fromName: null,
    ip: null,
    serverUUID: "888888888888888888888",
    serverName: "客服",
    userInfo: {}
  },
  onShow() {
    this.setData({
      uuid: wx.getStorageSync('userInfo').openId
    })
    this.connectServer();
  },
  connectServer() {

  },
  conectWebSocket() {
    
  },
  sendEmail() {

  },
  renderNewMsg(allUUIDArray) {
    
  },
  renderActive(userInfo) {
    
  },
  updateUserStatus(uuid, isOnline) {
    
  },
  send() {
    
  },
  dateTime2str(dateTime, format) {
    const z = {
      y: dateTime.getFullYear(),
      M: dateTime.getMonth() + 1,
      d: dateTime.getDate(),
      h: dateTime.getHours(),
      m: dateTime.getMinutes(),
      s: dateTime.getSeconds()
    };
    return format.replace(/(y+|M+|d+|h+|m+|s+)/g, v => {
      return ((v.length > 1 ? "0" : "") + z[v.slice(-1)]).slice(-2);
    });
  }


})